<template>
    <div>
        <el-dialog title="自定义列" :visible.sync="dialogVisible">
        <el-checkbox-group v-model="selectedColumns">
            <el-checkbox v-for="column in columns" :key="column.value" :label="column.value">{{ column.label }}</el-checkbox>
        </el-checkbox-group>
        <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="save">确 定</el-button>
        </span>
    </el-dialog>
    </div>
</template>
<script>
export default {
    data() {
        return {
            dialogVisible: false,
            selectedColumns: []
        };
    },
    props: {
        columns: {
            type: Array,
            default: () => []
        }
    },
    methods: {
        save() {
            this.$emit('save', this.selectedColumns);
            this.dialogVisible = false;
        }
    }
}
</script>